package com.changgou.task.task;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @description:
 * @author: 大佬味的小男孩
 * @date: 2020-08-07 12:54
 **/
@Component
public class OrderTask {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Scheduled(cron = "0 0 0 * * ?")
    public void autoTake(){
        System.out.println(new Date( ) );
        rabbitTemplate.convertAndSend( "","order_tack","-" );
    }
}
